<?php

header("Access-Control-Allow-Origin: *");
header("Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept");

include "../config.php";

$system = isset($_REQUEST['system']) ? $_REQUEST['system'] : '';
$tb_pre = isset($_REQUEST['tb_pre']) ? $_REQUEST['tb_pre'] : '';
$ip = isset($_REQUEST['ip']) ? $_REQUEST['ip'] : '';
$pv = isset($_REQUEST['pv']) ? $_REQUEST['pv'] : '';
$search = isset($_REQUEST['search']) ? $_REQUEST['search'] : '';
$message = isset($_REQUEST['message']) ? $_REQUEST['message'] : '';
$date = isset($_REQUEST['date']) ? $_REQUEST['date'] : '';


if(check_table_is_exist($system,$tb_pre."_login_admin")){
		
		$admin_list = select_lines_all_items("`".$system."`.".$tb_pre."_login_admin",''," open_id != '' ");
		
		$site_info = select_one_line_all_items("`".$system."`.".$tb_pre."_site","nid = 0 ");
		
		
		
		if($admin_list){
			foreach($admin_list as $val){
				
				$url = 'http://wx2.enpingshi.com/gater/api/send_admin_msg.php?openid='.$val['open_id'].'&ip='.$ip.'&pv='.$pv.'&search='.$search.'&message='.$message.'&date='.$date.'&site_name='.$site_info['name'].'&domin='.$site_info['domin'];
				
				_sock($url);
				
			}
		}
		
}


?>

